import java.util.Scanner;

public class demo4 {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        while (in.hasNext()) { // Use hasNext() for string inputs
            String s = in.next();
            boolean changed;
            do {
                changed = false;
                StringBuilder sb = new StringBuilder();
                int n = s.length();
                for (int i = 0; i < n; i++) {
                    if (i < n - 1 && s.charAt(i) == s.charAt(i + 1)) {
                        changed = true;
                        i++; // Skip the next character
                    } else {
                        // Handle the last character safely
                        if (i == n - 1 && (n == 1 || s.charAt(i) != s.charAt(i - 1))) {
                            sb.append(s.charAt(i));
                        } else if (i < n - 1 || (i == n - 1 && s.charAt(i) != s.charAt(i - 1))) {
                            sb.append(s.charAt(i));
                        }
                    }
                }
                s = sb.toString();
            } while (changed);
            System.out.println(s); // Print the final result
        }
    }
}
